-
Notifications
You must be signed in to change notification settings - Fork 184
[enh] add array API enabled compute_class_weight
function for use in classifier estimators
#2697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 7 files with indirect coverage changes 🚀 New features to boost your workflow:
|
/intelci: run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good, I just have a couple of questions.
Also check_class_weight
should be changed to compute_class_weight
in the description.
And just for the sake of general understanding it would be good to know why this functionality is implemented as a hidden function in case of array API?
@Vika-F you are absolutely right. I will change the title. |
check_class_weight
function for use in classifier estimatorscompute_class_weight
function for use in classifier estimators
/intelci: run |
/intelci: run |
/intelci: run |
Description
Scikit-learn does not yet support any classifiers for array API. As such, there are core functions like
compute_class_weight
which must be adapted locally for array API. This adds a private function_compute_class_weight
for use in sklearnex classifier estimators in order to enable them for array API. It uses an initial check usingget_namespace
and replicates line by line the functionality of sklearn written using the array API standard if necessary.This will be important for #2201 and #2209, as well as changes for KNeighborsClassifier.
Checklist:
Completeness and readability
Testing